<?php
namespace app\api\validate;

class Order extends Base
{
    protected $rule =   [
        #
        'goods_id'      => 'require|number',        // 商品ID
        'numbs'         => 'require|number',        // 商品ID
        'param'         => 'array',                 // 商品标题
        'order_id'      => 'require',               // 订单ID
    ];
    
    protected $message =   [
        'goods_id.require'      => '商品ID必须',
        'goods_id.number'       => '商品ID必须是数字',
        'numbs.require'         => '商品选购数量必须',
        'numbs.numbers'         => '商品选购数量必须是数字',
        'param'                 => '商品规格错误',
        'order_id'              => '订单ID必须',
    ];
    
    protected $scene =  [
        # 用户上传带规格的商品
        'cart_add'     => ['goods_id', 'numbs'],
        'order_id'     => ['order_id'],
    ];
    
}
